package com.cx.interact.server.lottery.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;
import com.cx.base.autoDoc.annotations.AutoDocType;
import com.cx.base.exception.SoaException;
import com.cx.interact.interfaces.lottery.dto.lottery.PrizeDTO;
import com.cx.interact.interfaces.lottery.dto.lottery.PrizeTypeDTO;
import com.cx.interact.interfaces.lottery.service.test.PrizeService;
import com.cx.interact.server.lottery.dao.PrizeDAO;



@Service
@Component
@AutoDocType("测试类")
public class PrizeServiceImpl implements PrizeService{

	@Resource
	private PrizeDAO prizeDAO;
	/**
	 * 查询活动奖项类别列表
	 * */
	public List<PrizeTypeDTO> getPrizeType() throws Exception{
		return prizeDAO.getPrizeType();
	}
	
	/**
	 * 保存或更新活动奖项信息列表
	 * */
	public Boolean saveOrUpdatePrize(PrizeDTO prizeDTO) throws SoaException{
		try {
			return prizeDAO.saveOrUpdatePrize(prizeDTO);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
	
	/**
	 * 查询活动奖项信息列表
	 * */
	public List<PrizeDTO> getPrize(Integer actId) throws Exception{
		return prizeDAO.getPrize(actId);
	}
	
	/**
	 * 删除活动奖项信息列表
	 * */
	public Boolean delPrize(Integer actId,Integer prizeId) throws Exception{
		return prizeDAO.delPrize(actId, prizeId);
	}
	
	/**
	 * 抽奖
	 * */
	public Boolean lottery(Integer actId) throws Exception{
		//统计概率
		
		
		return false;
	}

}
